# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=ccid
pkgver=1.5.4
pkgrel=0
pkgdesc="USB CCID/ICCD SmartCard reader driver"
url="https://ccid.apdu.fr/"
arch="all"
license="LGPL-2.1-or-later"
depends="pcsc-lite"
makedepends="flex libusb-dev pcsc-lite-dev perl zlib-dev"
source="https://ccid.apdu.fr/files/ccid-$pkgver.tar.bz2"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--enable-twinserial \
		--localstatedir=/var
	make
}

package() {
	make DESTDIR="$pkgdir" install

	mkdir -p "$pkgdir"/usr/lib/udev/rules.d/
	cp src/92_pcscd_ccid.rules "$pkgdir"/usr/lib/udev/rules.d/
}

sha512sums="
4b30f4768aebf49486a1b1e959615fa077bd393bfdd9e52c15bdc8d6ed63ce27fa7cf82a067d1f80d8b3534c66194036925d3fea5af64b6a775779d38267c757  ccid-1.5.4.tar.bz2
"
